<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
	<head>
		<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />		
		<meta charset="UTF-8">
		<title>我的项目</title>
		<link rel="stylesheet" href="${BASE_PATH}/static/app/css/reset.css" />
		<link rel="stylesheet" type="text/css" href="${BASE_PATH}/static/app/css/header.css"/>	
	    <link rel="stylesheet" href="${BASE_PATH}/static/app/css/myProject.css" />
	    <style type="text/css">
	    	.container{
				width: 100%;
				margin-top: 40px;
			}
	    </style>
	</head>
	<body>
	    <div class="header">
			<a href="/index"><span class="back"></span></a>
			<a href="/index"><span class="logo_pic"></span></a>
			<span class="logo_text">OK 妈咪</span>
		</div>
		<div id="projectList" class="container">
		
		</div>
	</body>
	<!-- lib -->
	<script type="text/javascript" src="${BASE_PATH}/static/lib/jquery/jquery-1.11.2.min.js"></script>
	<!-- amazeui -->
	<script type="text/javascript" src="${BASE_PATH}/static/ui/js/amazeui.min.js"></script>
	<!-- lib -->
	<script type="text/javascript" src="${BASE_PATH}/static/lib/swiper/js/swiper.jquery.min.js"></script>
	<script type="text/javascript" src="${BASE_PATH}/static/lib/layer/layer.js"></script>
	<script type="text/javascript" src="${BASE_PATH}/static/lib/template/template.js"></script>
	<script type="text/javascript" src="${BASE_PATH}/static/lib/jquery-lazyload/jquery.lazyload.min.js"></script>
	<script type="text/javascript" src="${BASE_PATH}/static/lib/jquery-marquee/jquery.marquee.min.js"></script>
	<script type="text/javascript" src="${BASE_PATH}/static/app/js/kit.js"></script>
	<script type="text/javascript" src="${BASE_PATH}/static/lib/myAlert/module.js"></script>
	<script type="text/html" id="dataTpl">
		{{each list as item index}}
			<div class="warp">
				<h3 class="warp-title">{{item.name}}<span>{{item.sale_date}}</span></h3>
		    	<table class="table">
			  		<tr>
			    		<th class="project-name">项目</th>
						<th>总手工量</th>
			    		<th>已做手工</th>
			  		</tr>
					{{each item.roduct as item2}}
						<tr>
			    			<td class="project-name">{{item2.pack_pro_name}}</td>
							<td>{{item2.numbers}}</td>			    
			    			<td>{{item2.yz_numbers}}</td> 
						</tr>
					{{/each}}
				</table>
			</div>
		{{/each}}
	</script>
	<script type="text/javascript">
		var pageNum = 0,totalPage = 1,loading = false;
		$(function(){
			//绑定“加载中”进入加载事件
			Kit.util.onPageEnd(function(){
	        	if(pageNum < totalPage && !loading){
	              	loading = true;
	              	$("#projectList").append("<div class=\"app-loading\">正在加载</div>");
	              	Kit.ajax.post("${BASE_PATH}/my/myInfo/myProjectPage",{pageNum:pageNum+1,pageSize:10},function(result){
						$("#projectList").append(template("dataTpl",result.object));
						$(".app-loading").remove();
						pageNum = result.object.pageNumber; 
						totalPage = result.object.totalPage;
						//重置加载标识
						loading = false;
					});
	        	}
			});
		});
	</script>
</html>
